clear all;

fig=figure('color',[1,1,1],'position',[20,40,800,400]);

load('result_OA8_A.mat');

% subplot(1,2,1)
ah1 = axes('Parent',fig,'Units','normalized','Position',[0.1300 0.3200 0.3347 0.624]);
plot(x_highkappa,y_highkappa,'-b', 'LineWidth', 2 );
xlabel('total wealth $m_t+a_t$', 'FontSize',12,'Interpreter','Latex');
ylabel('talent $z_t$', 'FontSize',12,'Interpreter','Latex');
title('A. Given $a_t/(m_t+a_t)$', 'FontSize',15,'Interpreter','Latex');
xlim([0,40])
ylim([1,3])
set(gca,'FontSize',12);
text(22, 2.6, 'migrate', 'FontSize',10,'Interpreter','Latex');
text(15, 1.45, 'not migrate', 'FontSize',10,'Interpreter','Latex');

legend('migration boundary ($\kappa=2.2$)','migration boundary ($\kappa=1.6$)','Interpreter','Latex',...
    'location',[0.52 0.12 0 0],'Numcolumns',2);
% get(handle, 'position')

load('result_OA8_B.mat');

% subplot(1,2,2)
ah2 = axes('Parent',fig,'Units','normalized','Position',[0.5703 0.3200 0.3347 0.624]);

plot(x_highkappa,y_highkappa,'-b', 'LineWidth', 2 );
xlabel('total wealth $m_t+a_t$', 'FontSize',12,'Interpreter','Latex');
ylabel('deposit-wealth ratio $a_t/(m_t+a_t)$', 'FontSize',12,'Interpreter','Latex');
title('B. Given $z_t$', 'FontSize',15,'Interpreter','Latex');
xlim([0,40])
ylim([0,1])
set(gca,'FontSize',12);
text(32, 0.5, 'migrate', 'FontSize',10,'Interpreter','Latex');
text(3, 0.5, 'not migrate', 'FontSize',10,'Interpreter','Latex');